<template>
  <div class="el-mr-streturnTable"> 
    <div class="el-mr-mh-firstbg">
      <el-table
        ref="receiveTable"
        size="mini"
        :data="resData"
        style="width: 100%"
        @selection-change="handleSelectionChange"
        highlight-current-row
      >
      <el-table-column type="selection" width="40"> </el-table-column>
      <el-table-column type="index" label="序号" width="50" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="barcode" label="条码"  :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="productName" label="机型" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="itemType" label="批次" :show-overflow-tooltip="true" > </el-table-column>
      <el-table-column prop="itemCode" label="架次" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="qualityCode" label="AO编号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="fproductType" label="AO名称" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="fproductPieceNo" label="标准件图号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="qty" label="质量编号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="qty" label="数量" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="unit" label="移交时间" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="sender" label="移交人" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="sendTime" label="接收时间" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="sender" label="接收人" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="remark" label="备注" :show-overflow-tooltip="true"> </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <el-pagination
      layout="prev, pager, next"
      :total="totalCount"
      :page-size="pageSize"
      @current-change="handleCurrentChange"
    >
    </el-pagination>
  </div>
</template>
<script>

import { mrMhAll } from "@/utils/api.js";

export default {
  name: "StreturnTable",
  data() {
    return {
      // 当前页数
      pageNumber: "",
      // 数据总个数
      totalCount: 0,
      // 返回的数据数组
      resData: [],
      // 每页数据个数
      pageSize: 4,
      // 确认列表高亮参数
      stableIndex: 0,
      value: "",
      ss: "",
      // 储存勾选的信息
      multipleSelection:[],
    };
  },
  methods: {
    // 勾选函数
    handleSelectionChange(val){
      this.multipleSelection = val
      this.$emit('standardReturnInfo',this.multipleSelection)
    },
    handleReceipt() {
      this.stableIndex = "";
    },
    handleRefuse() {},
    handleCurrentChange(val) {
      this.pageNumber = val;
    },
  },
  mounted() {
    this.$bus.$on('standardReturnSearch',(e)=>{
      console.log('标准件退货接收',e)
      this.resData = e.result
      this.totalCount = e.result.length
      // 因为接口为完成分页所以将数据个数作为每页个数
      this.pageSize = e.result.length
    })
  },
};
</script>
<style scoped>
.el-mr-mh-firstbg {
  width: 100%;
  height: 100%;
  text-align: center;
}
.el-pagination {
  text-align: center;
}
</style>